import Vue from 'vue'
import Router from 'vue-router'
import personalCenter from '@/components/personalCenter'
import index from '@/components/index'
import Goodsdetail from '@/components/Goodsdetail'
//详情页
import Description from '@/components/xiangqing/Description'
import Order from '@/components/xiangqing/Order'
//登录页面
import logon from '@/components/logon'
import Enter from '@/components/kyd/Enter'
import Forget from '@/components/kyd/Forget'
import Vip from '@/components/kyd/Vip'
//首页
import FirstPage from '@/components/kyd/FirstPage'
//积分商城
import Market from '@/components/kyd/Market'
//同城
import City from '@/components/kyd/City'
//礼拜五
import About from '@/components/kyd/About'
//关于礼拜五(三级路由)
import Newuser from '@/components/kyd/AboutFridy/Newuser'
//导航
import Navigation from '@/components/kyd/Navigation'
//搜索为空时
import SeachK from '@/components/kyd/SeachK'
//商品分类
import GoodsClass from '@/components/kyd/GoodsClass'
//个人中心
import myaccount from '@/components/personal/myaccount'
import myorder from '@/components/personal/myorder'
import mypoints from '@/components/personal/mypoints'
import integralorder from '@/components/personal/integralorder'
import mywallet from '@/components/personal/mywallet'
import personaldata from '@/components/personal/personaldata'
import adressmanagement from '@/components/personal/adressmanagement'
import mycollection from '@/components/personal/mycollection'
import recentbrowse from '@/components/personal/recentbrowse'
import changepassword from '@/components/personal/changepassword'
import mynews from '@/components/personal/mynews'
import feedback from '@/components/personal/feedback'

//购物车
import shopCarindex from '@/components/shopCar/shopCarindex'
import myshopCar from '@/components/shopCar/myshopCar'
import orderIntro from '@/components/shopCar/orderIntro'
import oldsite from '@/components/shopCar/oldsite'
import newsite from '@/components/shopCar/newsite'
import Ordersuccess from '@/components/shopCar/Ordersuccess'
Vue.use(Router)

export default new Router({
	routes: [{
			path: '/',
			name: 'index',
			components: {
				first: index
			},children:[{
				path:'/FirstPage',
				components:{
					second:FirstPage
				}			
			},{
				path:'/Market',
				components:{
					second:Market
				}
			},{
				path:'/City',
				components:{
					second:City
				}
			},{
				path:'/About',
				components:{
					second:About
				},children:[{
					path:'/Newuser',
					components:{
					third:Newuser
				}
			}]
			},{
				path:'/Navigation',
				components:{
					second:Navigation
				}
			},
			{
				path:'/SeachK',
				name:'SeachK',
				components:{
					second:SeachK
				}
			},
			{
				path:'/GoodsClass',
				name:'GoodsClass',
				components:{
					second:GoodsClass
				}
			}],
			redirect:"/city"
		},
		{
			path: '/personalCenter',
			components: {
				first: personalCenter
			},children:[{
		    	  	path:"/myaccount",
		    	  	components:{
		    	  		second:myaccount
		    	  	}
		    	  },{
		    	  	path:"/myorder",
		    	  	components:{
		    	  		second:myorder
		    	  	}
		    	  },{
		    	  	path:"/mypoints",
		    	  	components:{
		    	  		second:mypoints
		    	  	}
		    	  },{
		    	  	path:"/integralorder",
		    	  	components:{
		    	  		second:integralorder
		    	  	}
		    	  },{
		    	  	path:"/mywallet",
		    	  	components:{
		    	  		second:mywallet
		    	  	}
		    	  },{
		    	  	path:"/personaldata",
		    	  	components:{
		    	  		second:personaldata
		    	  	}
		    	  },{
		    	  	path:"/adressmanagement",
		    	  	components:{
		    	  		second:adressmanagement
		    	  	}
		    	  },{
		    	  	path:"/mycollection",
		    	  	components:{
		    	  		second:mycollection
		    	  	}
		    	  },{
		    	  	path:"/recentbrowse",
		    	  	components:{
		    	  		second:recentbrowse
		    	  	}
		    	  },{
		    	  	path:"/changepassword",
		    	  	components:{
		    	  		second:changepassword
		    	  	}
		    	  },{
		    	  	path:"/mynews",
		    	  	components:{
		    	  		second:mynews
		    	  	}
		    	  },{
		    	  	path:"/feedback",
		    	  	components:{
		    	  		second:feedback
		    	  	}
		    	  }],redirect:"/myaccount"
		},
		{
			path: '/Goodsdetail',
			components: {
				first: Goodsdetail
			},
			children:[{
				path:'/Description/:goodsId',
				components:{
					second:Description
				}
			},{
				path:'/Order',
				components:{
					second:Order
				}
			}],
			redirect:"/Description/:goodsId"
		},
		{
			path:'/logon',
			components:{
			first:logon
			},children:[{
				path:'/Enter',
				components:{
				second:Enter
				}
			},{
				path:'/Forget',
				components:{
				second:Forget
				}
			},
			{
				path:'/Vip',
				components:{
				second:Vip
				}
			}]
		},
		{
			path:'/shopCarindex',
			components:{
				first:shopCarindex
			},children:[{
				path:'/myshopCar',
				components:{
				second:myshopCar
				}
			},{
				path:'/orderIntro',
				components:{
				second:orderIntro
				},
				children:[{
					path:'/oldsite',
					components:{
					third:oldsite
					}
				},
				{
					path:'/newsite',
					components:{
					third:newsite
					}
				}],
				redirect:"/oldsite"
			},{
				path:'/Ordersuccess',
					components:{
					second:Ordersuccess
					}
			}],
			redirect:"/myshopCar"
		}
	]
})